import axios from 'axios';
// 创建axios实例
const service = axios.create({
  baseURL: 'http://localhost:8080/o2o',
  timeout: 6000, // 请求超时时间
});

axios.interceptors.response.use(
  response => {
    // 请求正常则返回
    if (response.data.errKey == 10001) {
      sessionStorage.removeItem('userName');
    }
    return response.data;
  }
  ,
  error => error,
);

export default service;
